package com.hawthorn.redis.controller;

import com.hawthorn.redis.service.menu.MenuCacheService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>todo 系统菜单缓存</p>
 * @author: andy.ten@tom.com | xukaixing@hotmail.com
 * @created: 2021/12/19 2:25 PM
 * @version v1.0.2
 * @copyright: Copyright (c)  andyten
 */
@Api(tags = {"redis-sysmenu"})
@RestController
@RequestMapping("/menu")
@Slf4j
public class MenuCacheController
{
  @Autowired
  private MenuCacheService menuCacheService;

  /**
   * <p>todo 重新加载菜单</p>
   * @author: andy.ten@tom.com
   * @date: 2021/12/20 8:37 PM
   * @version: 1.0.1
   */
  @ApiOperation(value = "加载->重新初始化菜单", notes = "重新初始化菜单")
  @ApiImplicitParams({

  })
  @GetMapping(value = "reloadMenu")
  public void reloadMenu()
  {
    menuCacheService.init();
  }
}
